﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// SN 进站信息。
/// </summary>
/// <remarks>
/// 记录产品进站信息。
/// </remarks>
[SugarTable("prod_inbound")]
public class ProdInbound : EntityBaseId
{
    /// <summary>
    /// 产线 Id。
    /// </summary>
    public long LineId { get; set; }

    /// <summary>
    /// 产线编号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "产线编号", Length = 32)]
    public string? LineCode { get; set; }

    /// <summary>
    /// 工位 Id。
    /// </summary>
    public long OpId { get; set; }

    /// <summary>
    /// 工位编号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "工位编号", Length = 32)]
    public string? OpCode { get; set; }

    /// <summary>
    /// 工序 Id。没有则为 0。
    /// </summary>
    public long ProcId { get; set; }

    /// <summary>
    /// 工序编号。没有则为空。
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "工序编号", Length = 32)]
    public string? ProcCode { get; set; }

    /// <summary>
    /// SN
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "SN", Length = 64)]
    public string? Sn { get; set; }

    /// <summary>
    /// 产品编号
    /// </summary>
    [SugarColumn(ColumnDescription = "产品编号", Length = 64)]
    public string? ProductCode { get; set; }

    /// <summary>
    /// 工单号，没有则为空。
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "工单号", Length = 32)]
    public string? Wo { get; set; }

    /// <summary>
    /// 配方号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "配方号")]
    public string? FormualNo { get; set; }

    /// <summary>
    /// RFID 编号
    /// </summary>
    [SugarColumn(ColumnDescription = "RFID 编号", Length = 64)]
    public string? Rfid { get; set; }

    /// <summary>
    /// 进站时间
    /// </summary>
    [SugarColumn(ColumnDescription = "进站时间")]
    public DateTime InboundTime { get; set; }

    /// <summary>
    /// 数据版本。
    /// </summary>
    /// <remarks>用于数据关联</remarks>
    [SugarColumn(ColumnDescription = "数据版本")]
    public long Version { get; set; }
}
